<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="{CSS_PATH}pintuer.css">
<link rel="stylesheet" href="{CSS_PATH}admin.css">
<script src="{JS_PATH}jquery.js"></script>
<script src="{JS_PATH}pintuer.js"></script>
  <link rel="stylesheet" href="{EDITOR_PATH}themes/default/default.css" />
  <link rel="stylesheet" href="{EDITOR_PATH}plugins/code/prettify.css" />
  <script charset="utf-8" src="{EDITOR_PATH}kindeditor.js"></script>
  <script charset="utf-8" src="{EDITOR_PATH}lang/zh_CN.js"></script>
  <script charset="utf-8" src="{EDITOR_PATH}plugins/code/prettify.js"></script>
  <script src="{JS_PATH}upload.js"></script>
  <script>
      KindEditor.ready(function(K) {
          var editor1 = K.create('textarea[name="content1"]', {
              cssPath : '{EDITOR_PATH}plugins/code/prettify.css',
              uploadJson : '{EDITOR_PATH}php/upload_json.php',
              fileManagerJson : '{EDITOR_PATH}php/file_manager_json.php',
              allowFileManager : true,
              afterCreate : function() {
                  var self = this;
                  K.ctrl(document, 13, function() {
                      self.sync();
                      K('form[name=example]')[0].submit();
                  });
                  K.ctrl(self.edit.doc, 13, function() {
                      self.sync();
                      K('form[name=example]')[0].submit();
                  });
              }
          });
          prettyPrint();
      });
  </script>
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>增加内容</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="index.php?m=admin&f=tent&a=updatecon">
      <input type="hidden" value="{$data['id']}" name="id">
      <div class="form-group">
        <div class="label">
          <label>分类：</label>
        </div>
        <div class="field">
          <select name="catid" class="input w50">
            {foreach $tents $v}
            {if $v['id']==$data['catid']}
            <option value="{$v['id']}" selected>{$v['name']}</option>
            {else}
            <option value="{$v['id']}">{$v['name']}</option>
            {/if}
            {/foreach}
          </select>
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>标题：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="{$data['title']}" name="title" data-validate="required:请输入标题" />
          <div class="tips"></div>
        </div>
      </div>

      <div class="form-group">
        <div class="label">
          <label>缩略图</label>
        </div>
        <div class="field">
          <input type="file" id="file">
          <input type="hidden" id="hidden" name="hidden" value="{$data['thumb']}">
          <div class="box input" id="show" style="width: 300px;height: 100px;border: 1px solid #ccc;margin: 5px 0">
            <img src="{$data['thumb']}" alt="" style="height: 100%; width: auto;">
          </div>
          <div class="progress" style="width: 200px;height: 10px;border: 1px solid #ccc;">
            <div id="inner" style="height: 10px; background: #00AAEE;width: 0;">

            </div>
          </div>
          <input type="button" id="btn" value="上传" class="button sm-main icon-check-square-o" style="margin-top: 5px;height: ;">
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>推荐位</label>
        </div>
        <div class="field" style="padding-top:8px;">
          <input type="radio" value="0" name="posid" checked>不推荐
          {foreach $pos as $v}
          {if $v['id']==$data['posid']}
          <input type="radio" value="{$v['id']}" name="posid" checked>{$v['name']}
          {else}
          <input type="radio" value="{$v['id']}" name="posid">{$v['name']}
          {/if}
          {/foreach}
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>描述：</label>
        </div>
        <div class="field">
          <textarea class="input" name="description" style=" height:90px;">{$data['description']}</textarea>
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>内容：</label>
        </div>
        <div class="field">
          <textarea name="content1" class="input" style="height:450px; border:1px solid #ddd;">{$data['content']}</textarea>
          <div class="tips"></div>
        </div>
      </div>
      <div class="clear"></div>
      <div class="form-group">
        <div class="label">
          <label>发布时间：</label>
        </div>
        <div class="field"> 
          <script src="js/laydate/laydate.js"></script>
          <input type="date" class="laydate-icon input w50" name="datetime" value="{$data['time']}"  data-validate="required:日期不能为空" style="padding:10px!important; height:auto!important;border:1px solid #ddd!important;" />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>作者：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="source" value="{$data['source']}"  />
          <div class="tips"></div>
        </div>
      </div>

      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
<script>
    var up=new upload("index.php?m=admin&f=tent&a=upload",{
        fileobj:"#file",
        hiddenobj:"#hidden",
        show:"#show",
        inner:"#inner",
        btn:"#btn"
    });
    up.upload();
    //封装 所有的类 实例化就可以用 一个对象包含所有的功能
    //父类的方法 子类继承后  smarity  jump方法 checklogin方法  后代类继承后可以直接调用
</script>
</body></html>